package testrank;

import java.io.Serializable;

/**
 * (methodSignature, testSignature) such that method is covered by test
 * 
 * @author Hagai Cibulski
 *
 */
public class Conflict implements Serializable {

	private static final long serialVersionUID = 1L;

	private String methodSignature;
	
	private String testSignature;

	public Conflict(String methodSignature, String testSignature) {
		super();
		this.methodSignature = methodSignature;
		this.testSignature = testSignature;
	}

	/**
	 * @return the methodSignature
	 */
	public String getMethodSignature() {
		return this.methodSignature;
	}

	/**
	 * @param methodSignature the methodSignature to set
	 */
	public void setMethodSignature(String methodSignature) {
		this.methodSignature = methodSignature;
	}

	/**
	 * @return the testSignature
	 */
	public String getTestSignature() {
		return this.testSignature;
	}

	/**
	 * @param testSignature the testSignature to set
	 */
	public void setTestSignature(String testSignature) {
		this.testSignature = testSignature;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Conflict [methodSignature=" + this.methodSignature
				+ ", testSignature=" + this.testSignature + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((this.methodSignature == null) ? 0 : this.methodSignature
						.hashCode());
		result = prime
				* result
				+ ((this.testSignature == null) ? 0 : this.testSignature
						.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Conflict other = (Conflict) obj;
		if (this.methodSignature == null) {
			if (other.methodSignature != null)
				return false;
		} else if (!this.methodSignature.equals(other.methodSignature))
			return false;
		if (this.testSignature == null) {
			if (other.testSignature != null)
				return false;
		} else if (!this.testSignature.equals(other.testSignature))
			return false;
		return true;
	}
}
